-
Notifications
You must be signed in to change notification settings - Fork 772
Improve binding logic and logging in ActionMessage.cs #970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve binding logic and logging in ActionMessage.cs #970
Conversation
- Updated binding initialization to use object initializer syntax for better readability. - Enhanced logging for `source` enabled status, including checks for `source.Name`. - Added logging to indicate whether `source` is enabled or disabled after `CanExecute` check. - Implemented null checks for `source` and its `DataContext` to prevent null reference exceptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
} | ||
else | ||
{ | ||
Log.Info("Skipping is enabled because source Name is not set"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The log message 'Skipping is enabled because source Name is not set' is unclear. It should be 'Skipping enabling source because Name is not set'.
Log.Info("Skipping is enabled because source Name is not set"); | |
Log.Info("Skipping enabling source because Name is not set"); |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated log text to Skipping IsEnabled source because source Name is not set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
src/Caliburn.Micro.Platform/ActionMessage.cs:547
- The log message 'Skipping is enabled because source Name is not set' is unclear. It should be 'Skipping enable check because source Name is not set'.
Log.Info("Skipping is enabled because source Name is not set");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
src/Caliburn.Micro.Platform/ActionMessage.cs:547
- [nitpick] The logging message 'Skipping IsEnabled source because source Name is not set' could be more descriptive. Consider changing it to 'Skipping IsEnabled check because source Name is not set'.
Log.Info("Skipping IsEnabled source because source Name is not set");
src/Caliburn.Micro.Platform/ActionMessage.cs:537
- Ensure that the new logging behavior added in the ApplyAvailabilityEffect method is covered by tests.
if (!hasBinding && context.CanExecute != null)
This pull request includes changes to the
src/Caliburn.Micro.Platform/ActionMessage.cs
file to improve code readability and logging details. The most important changes include reformatting theBinding
initialization, adding detailed logging for theApplyAvailabilityEffect
method, and adding a new line for better code separation.Code readability improvements:
Binding
initialization to follow a more consistent code style.Logging enhancements:
ApplyAvailabilityEffect
method to log the state of thesource.Name
and whether the source is enabled or disabled.Code separation:
ToString
method.ActionMessageGuard.mp4
closing #657